package com.zhixue.base.exception;

/**
 * @author Dragon
 * @description 自定义异常
 * @date 2023/9/20 16:33
 */
public class ZhiXueException extends RuntimeException {
    private String errMessage;

    public String getErrMessage() {
        return errMessage;
    }

    public ZhiXueException(String errMessage) {
        super(errMessage);
        this.errMessage = errMessage;
    }

    public static void cast(CommonError commonError) {
        throw new ZhiXueException(commonError.getErrMessage());
    }

    public static void cast(String errMessage) {
        throw new ZhiXueException(errMessage);
    }
}

